package com.mie.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @Author Mie
 * @Description Swagger配置类
 * @Date 2021/11/11 12:58
 **/
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
    /**
     * @Description 访问地址：http://localhost:8182/swagger-ui.html
     * 添加接口文档的相关属性和要展示的信息。
     **/
    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.mie"))
                .build().apiInfo(new ApiInfoBuilder()
                        .title("file系统测试接口")
                        .description("相关接口测试")
                        .version("V1.0")
                        .build());
    }
}
